<!DOCTYPE html>
<html>
<head>
<title>出差</title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			#if($shiro.hasPermission("businesstravel:save"))
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			#end
			#if($shiro.hasPermission("businesstravel:update"))
			<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			#end
			#if($shiro.hasPermission("businesstravel:delete"))
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			#end
			#if($shiro.hasPermission("businesstravel:list"))
			<a class="btn btn-primary" @click="queryfile"></i>&nbsp;查看附件</a>
			#end
			#if($shiro.hasPermission("businesstravel:submit"))
			<a class="btn btn-primary" @click="submit"><i class="fa fa-pencil-square-o"></i>&nbsp;提交</a>
			#end
			#if($shiro.hasPermission("businesstravel:processInt"))
			<a class="btn btn-primary" @click="processInt"><i class="fa fa-pencil-square-o"></i>&nbsp;审批</a>
			#end
			#if($shiro.hasPermission("businesstravel:popHistory"))
			<a class="btn btn-primary" @click="popHistory"><i class="fa fa-pencil-square-o"></i>&nbsp;审批历史记录</a>
			#end
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList&&!showtable" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
											<div class="form-group">
			   	<div class="col-sm-2 control-label">出差地点</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="businessTravel.place" placeholder="出差地点"/>
			    </div>
			</div>
			<div class="form-group">
			<div class="col-sm-2 control-label">开始日期</div>
			<div class="col-sm-10">
				<input type="text" class="form-control"  id="startDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  readonly="readonly"   v-model="businessTravel.startDate" placeholder="开始时间"/>
			</div>
		</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">结束日期</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="businessTravel.endDate" id="endDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  readonly="readonly"  placeholder="结束时间"/>
				</div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">出差天数</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="businessTravel.days" placeholder="出差天数"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">出差事由</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="businessTravel.reason" placeholder="出差事由"/>
			    </div>
			</div>

							<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>

	<div v-show="showtable" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group"  >
				<div class="col-sm-2 control-label">审批意见</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="businessTravel.remark" placeholder="审批意见"/>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="process" value="批准"/>
				<input type="button" class="btn btn-primary" @click="reject" value="拒绝"/>
				<input type="button" class="btn btn-primary" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<!-- 弹出历史记录 -->
<div id="popHistory" style="display: none;padding:10px;">
	<table id="popHistoryGrid"></table>
	<div id="popHistoryGridPager"></div>
</div>

<!-- 弹出历史记录 -->
<div id="popUser" style="display: none;padding:10px;">
	<table id="popUserGrid"></table>
	<div id="popUserGridPager"></div>
</div>

<script src="${rc.contextPath}/js/workflow/businesstravel.js?_${date.systemTime}"></script>
</body>
</html>